import { UserInfo } from "@/api"
import { LoginType } from "../actions"
import { UserAction } from "../actions/user"

const initialState = {} as UserInfo

// 函数 +初始化状态
// action 先写成any
const login = (state: UserInfo = initialState, action: UserAction) => {
  switch (action.type) {
    case 'user/info':
      return action.info
    default:
      return state
  }
}

export default login
